package com.caine.order.feign.factory;

import com.caine.order.feign.IPaymentFeignService;
import com.caine.order.feign.fallback.PaymentFeignServiceImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: CaineZhu
 * @Description:
 * @Date: Created in 10:28 2021/1/5
 * @Modified By:
 */
@Component
public class PaymentFeignServiceFallbackFactory implements FallbackFactory<IPaymentFeignService> {
    @Autowired
    private PaymentFeignServiceImpl obj;
    @Override
    public IPaymentFeignService create(Throwable throwable) {
        System.out.println("支付服务异常信息:" + throwable.getMessage());
        return obj;
    }
}
